home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 August (Alt) / CHIP 2005-08.1.iso / program / guvenlik / syslinux-3.07.exe / com32 / samples / fancyhello.c < prev    next >
Encoding:
C/C++ Source or Header  |  2004-12-14  |  1.2 KB  |  44 lines

  1.  
  2. #ident "$Id: fancyhello.c,v 1.2 2004/12/14 22:46:25 hpa Exp $"
  3. /* ----------------------------------------------------------------------- *
  4.  *   
  5.  *   Copyright 2004 H. Peter Anvin - All Rights Reserved
  6.  *
  7.  *   This program is free software; you can redistribute it and/or modify
  8.  *   it under the terms of the GNU General Public License as published by
  9.  *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
  10.  *   Boston MA 02111-1307, USA; either version 2 of the License, or
  11.  *   (at your option) any later version; incorporated herein by reference.
  12.  *
  13.  * ----------------------------------------------------------------------- */
  14.  
  15. /*
  16.  * fancyhello.c
  17.  *
  18.  * Hello, World! using libcom32 and ANSI console; also possible to compile
  19.  * as a Linux application for testing.
  20.  */
  21.  
  22. #include <string.h>
  23. #include <stdio.h>
  24.  
  25. #include <consoles.h>        /* Provided by libutil */
  26.  
  27. int main(void)
  28. {
  29.   char buffer[1024];
  30.  
  31.   console_ansi_std();
  32.  
  33.   printf("\033[1;33;44m *** \033[37mHello, World!\033[33m *** \033[0m\n");
  34.  
  35.   for (;;) {
  36.     printf("\033[1;36m>\033[0m ");
  37.     fgets(buffer, sizeof buffer, stdin);
  38.     if ( !strncmp(buffer, "exit", 4) )
  39.       break;
  40.     printf("\033[1m:\033[0m %s", buffer);
  41.   }
  42.   return 0;
  43. }
  44.